<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<script type="text/javascript">
<!--
	function orderpermanselectorg(){
		var dlgId = "report";
		var title="选择部门";
		var url = ctx+"/common/organization-ui!getOrgUL.action?code=ROOT&idInput=org&nameInput=orgName&form=orderperman&dlgID=report";
		$.pdialog.open(url, dlgId, title,{width:600,height:400});
	}
	function exportorderperman(){
		var url = "${ctx }/crm/report/order-per-man!export.action";
		var ym = $("#orderpermanyear").val();
		var org = $("#orderperman input[name='org']").val();
		url+="?";
		url+="year="+ym;
		url+="&org="+org;
		window.open(url);
		}
//-->
</script>
<form id="pagerForm" method="post" action="${ctx }/crm/report/order-per-man.action">
	<input type="hidden" name="status" value="${param.status}">
	<input type="hidden" name="keywords" value="${param.keywords}" />
	<input type="hidden" name="pageNum"  value="${page.pageNo}" />
	<input type="hidden" name="numPerPage" id="numPerPage" value="${page.pageSize}" />
	<input type="hidden" name="orderField" value="${param.orderField}" />
</form>
<div class="page">
	<div class="pageHeader">
		<form id="orderperman" onsubmit="return navTabSearch(this);" action="${ctx }/crm/report/order-per-man.action" method="post">
		<div class="searchBar">
			<ul class="searchContent">
				<li>
					<label>选择年份：</label>
					<span>
					<input type="text" name="year" id="orderpermanyear" size="20" value="${year}" onfocus="WdatePicker({el:'orderpermanyear',dateFmt:'yyyy'})"/>
					</span>
				</li>
					<li>
					<label>选择部门：</label>
					<span>
					<input type="hidden" name="org" id="org" size="20" value="${org}"/>
					<input type="text" name="orgName" id="orgName" size="20" value="" onfocus="orderpermanselectorg();"/>
					</span>
				</li>
			</ul>
			<div class="subBar">
				<ul>
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit"> 检 索 </button></div></div></li>
					<li><div class="buttonActive"><div class="buttonContent"><button type="button" onclick="exportorderperman()"> 导 出 </button></div></div></li>
				</ul>
			</div>
		</div>
		</form>
	</div>
	<div class="pageContent">
		 <div id="orderPerManDIV" >
			请按条件查询！
		</div>
		<script language="JavaScript">					
			var depart = "";
			var orderPerManchart1 = new FusionCharts(Column3D, "chart1Id", "800", "350", "0", "1");				
			var xml = "<chart caption='${year} 业 务 员 有 效 订 单 统 计' xAxisName='业务员' yAxisName='订单数（个）'";
			xml+=" rotateYAxisName='1' baseFont='宋体' baseFontSize='14' palette='10'";
			xml+=" showBorder='0' exportEnabled='1' exportHandler='"+explorer+"' exportAtClient='0' exportAction='download'";
			xml+=" exportFileName='SoGoodSoft'";
			xml+=" >"
			<s:iterator value="list" var="obj">
			xml+="<set label='${obj[0]}' value='${obj[1]}' />";
			depart = "${obj[2]}"
			</s:iterator>	
			$("#orderperman input[id='orgName']").val(depart);
			xml+="</chart>";
			orderPerManchart1.setDataXML(xml);
			orderPerManchart1.render("orderPerManDIV");
			
		</script>

		
	</div>
</div>